<template>
  <el-card>
    <el-table
      v-loading="loading"
      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
      :data="orderData"
      border
      :stripe="true"
      class="Top"
      style="width: 100%"
    >
      <el-table-column
        prop="createTime"
        :label="tableText['bindTime']"
        min-width="150"
      />
      <el-table-column
        prop="bankName"
        :label="tableText['bankName']"
        min-width="150"
      />
      <el-table-column
        prop="bankCode"
        :label="tableText['bankNumber']"
        min-width="150"
      />
      <el-table-column
        prop="bankCardNum"
        :label="tableText['bankCardNumber']"
        min-width="150"
      />
      <el-table-column
        prop="isCheck"
        :label="tableText['checkCardNumber']"
        min-width="150"
      >
        <template slot-scope="scope">
          {{ $t('orderModule.bank.checkCardNumber')[scope.row['isCheck']] }}
        </template>
      </el-table-column>
      <el-table-column
        prop="status"
        :label="tableText['state']"
        min-width="150"
      >
        <template slot-scope="scope">
          {{ $t('orderModule.bank.status')[scope.row['status']] }}
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script>
import { getBankCard } from '@/api/user'
export default {
  name: 'BankDetail',
  data() {
    return {
      tableText: {},
      loading: true,
      orderData: []
    }
  },
  mounted() {
    this.tableText = this.$t('orderModule.bank.table')
    this.getInfo()
  },
  methods: {
    getInfo() {
      this.loading = true
      getBankCard(this.$route.query.userId)
        .then(res => {
          this.loading = false
          if (res.success) {
            this.orderData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.loading = false
          this.$message.error(err.message)
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.el-card{
  margin: 10px;
}
</style>
